﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace Entity.order
{
    /// <summary>
    /// 订单表类
    /// </summary>
    [Table("t_shop_order")]
    public class Order
    {
        /// <summary>
        /// 订单ID
        /// </summary>
        [Key]
        public string ID { get; set; }

        /// <summary>
        /// 订单用户ID
        /// </summary>
        public string OrderID { get; set; }

        /// <summary>
        /// 收货地址
        /// </summary>
        public string Shaddress { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string number { get; set; }

        /// <summary>
        /// 下单时间
        /// </summary>
        public DateTime PlaceTime { get; set; }

        /// <summary>
        /// 付款时间
        /// </summary>
        public DateTime PaymentTime { get; set; }


        /// <summary>
        /// 状态1待付款，2表示待发货，3待收货。4交易完成。
        /// </summary>

        public int Status { get; set; }

        /// <summary>
        /// 状态描述
        /// </summary>
        public string StatusDesc
        {
            get
            {
                if (Status == 1)
                {
                    return "待付款";
                }
                else if (Status == 2)
                {
                    return "待发货";
                }
                else if (Status == 3)
                {
                    return "待收货";
                }
                else if (Status == 4)
                {
                    return "交易完成";
                }
                else
                {
                    return "";
                }

            }
        }

    }
}
